<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CreateImageMenu</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">CreateImageMenu()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Result = <font color="#006666"><b>CreateImageMenu</b></font>(#Menu, WindowID [, Flags])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Creates a new empty menu on the given window with support for images in the menu items. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Menu</i></td>
<td width="90%"> 
 
A number to identify the new menu. 
<a href="../reference/purebasic_objects.html">#PB_Any</a> can be used to auto-generate this number. 

 

</td></tr>
<tr><td><i>WindowID</i></td>
<td> 
 
The window for the new menu. It can be obtained using the <a href="../window/windowid.html">WindowID()</a> function. 

 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
 
This can be a combination of the following values: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Menu_ModernLook</font>: Enable gradient and modern look (only has an effect on Windows)
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Nonzero if the menu was successfully created, zero otherwise. If <font color="#924B72">#PB_Any</font> was used 
for the #Menu parameter then the generated number is returned on success. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



Once created, this menu becomes the current menu for further item additions. It's now 
possible to use functions such as <a href="menutitle.html">MenuTitle()</a>, <a href="menuitem.html">MenuItem()</a>, <a href="menubar.html">MenuBar()</a>, <a href="opensubmenu.html">OpenSubMenu()</a> to populate the menu. 
<br>
<br>
To handle menu events properly, see the description of following functions: 
<br>
<a href="../window/waitwindowevent.html">WaitWindowEvent()</a> (alternatively <a href="../window/windowevent.html">WindowEvent()</a>) 
<br>
<a href="../window/eventwindow.html">EventWindow()</a> 
<br>
<a href="../window/eventmenu.html">EventMenu()</a> 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">LoadImage</font>(0,<font color="#006666"> OpenFileRequester</font>("Choose an icon file", "", "", 0))
    <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 200, 200, 200, 100, "Image menu Example")
      <b><font color="#006666">If</font></b> <font color="#006666">CreateImageMenu</font>(0,<font color="#006666"> WindowID</font>(0))    <font color="#006666">; menu creation starts....</font>
<font color="#006666">        MenuTitle</font>("Project")
<font color="#006666">          MenuItem</font>(1, "Open"   +<font color="#006666">Chr</font>(9)+"Ctrl+O",<font color="#006666"> ImageID</font>(0))
<font color="#006666">          MenuItem</font>(2, "Save"   +<font color="#006666">Chr</font>(9)+"Ctrl+S")
<font color="#006666">          MenuItem</font>(3, "Save as"+<font color="#006666">Chr</font>(9)+"Ctrl+A")
<font color="#006666">          MenuItem</font>(4, "Close"  +<font color="#006666">Chr</font>(9)+"Ctrl+C")
      <b><font color="#006666">EndIf</font></b>
      
      <b><font color="#006666">Repeat</font></b> : <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
    <b><font color="#006666">EndIf</font></b>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="createmenu.html">CreateMenu()</a>, <a href="createpopupmenu.html">CreatePopupMenu()</a>, <a href="createpopupimagemenu.html">CreatePopupImageMenu()</a>, <a href="freemenu.html">FreeMenu()</a>, <a href="menutitle.html">MenuTitle()</a>, <a href="menuitem.html">MenuItem()</a>, <a href="menubar.html">MenuBar()</a>, <a href="opensubmenu.html">OpenSubMenu()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=closesubmenu.html>CloseSubMenu()</a> - <a href=index.html>Menu Index</a> - <a href=createmenu.html>CreateMenu()</a> -&gt;



</body></html>